import Vue from 'vue'
import vueRouter from 'vue-router'
Vue.use(vueRouter);
const router = new vueRouter({
    routes: [
        {
            path: '/',
            redirect: { name: 'home' }
        },
        {
            name: 'home',
            path: '/home',
            component: () => import('@/views/Home/Home.vue')
        },
        // 图片列表 
        {
            name: 'member',
            path: '/member',
            component: () => import('@/views/member.vue')
        },
        {
            name: 'search',
            path: '/search',
            component: () => import('@/views/search.vue')
        },
        {
            name: 'ImgList',
            path: '/ImgList',
            component: () => import('@/views/Images/ImgList.vue')
        },

        {
            name: 'newsList',
            path: '/news/list',
            component: () => import('@/views/News/newsList.vue')
        },

        {
            name: 'NewsDetial',
            path: '/new/show/:id',
            props: true,
            component: () => import('@/views/News/NewsDetial.vue')
        },


        // 任务5——————————————
        // 商品列表GoodsList
        {
            name: 'GoodsList',
            path: '/GoodsList',
            component: () => import('@/views/Goods/GoodsList.vue')
        },
        // 商品详情GoodsDetial
        {
            name: 'GoodsDetial',
            path: '/GoodsDetial/:id',
            component: () => import('@/views/Goods/GoodsDetial.vue'),
            props: true,

        },
        // 商品评论
        {
            name: 'GoodsComment',
            path: '/goods/comment/:id',
            component: () => import('@/views/Goods/GoodsComment.vue'),
            // props: true,

        },
        {
            name: 'desc',
            path: '/goods/desc/:id',
            component: () => import('@/views/Goods/GoodsDesc.vue')
        },


        {
            name: 'CarList',
            path: '/CarList/:id?',
            component: () => import('@/views/Car/CarList.vue')
        },
        {
            // 图片详情页 
            name: 'ImgDetial',
            path: '/ImgDetial/:id',
            component: () => import('@/views/Images/ImgDetial.vue'),
            props: true
        },

    ]
})

export default router